//
//  WeHomeController.m
//  WeGalaxy
//
//  Created by Zheng on 2017/6/29.
//  Copyright © 2017年 Zheng. All rights reserved.
//

#import "WeHomeController.h"

#import "WeDetailController.h"
#import "WeAuctionPublishController.h"
#import "WePersonalController.h"
#import "WeMyAuctionController.h"
#import "WeAuctionMapController.h"
#import "WeHomePageController.h"
#import "WeSellerMessageController.h"

@interface WeHomeController ()

@end

@implementation WeHomeController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"首页";
    
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
    self.navigationController.navigationBar.translucent = NO;
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - tableview delegate&&datasource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [[UITableViewCell alloc] init];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
    NSString *title = @"";
    
    switch (indexPath.row) {
        case 0:
            title = @"点击跳转详情页面";
            break;
        case 1:
            title = @"点击跳转拍卖发布页面";
            break;
        case 2:
            title = @"点击跳转个人页面";
            break;
        case 3:
            title = @"点击跳转我的拍卖页面";
            break;
        case 4:
            title = @"点击了拍卖地图页面";
            break;
        case 5:
            title = @"点击了仿阿里云页面";
            break;
        case 6:
            title = @"点击了联系卖家";
            break;

        default:
            break;
    }
    
    cell.textLabel.text = title;
    
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    switch (indexPath.row) {
        case 0:
        {
#pragma mark 跳转详情页面
            WeDetailController *detailVC = [[WeDetailController alloc] init];
            [self pushWithController:detailVC];
        }
            break;
        case 1:
        {
#pragma mark 跳转拍卖发布页面
            WeAuctionPublishController *publishVC = [[WeAuctionPublishController alloc] init];
            [self pushWithController:publishVC];
        }
            break;
#pragma mark 跳转个人页面
        case 2:
        {
            WePersonalController *personalVC = [[WePersonalController alloc] init];
            [self pushWithController:personalVC];
        }
            break;
#pragma mark 跳转我的拍卖页面
        case 3:
        {
            WeMyAuctionController *myActionVC = [[WeMyAuctionController alloc] init];
            [self pushWithController:myActionVC];
        }
            break;
#pragma mark 跳转拍卖地图页面
        case 4:
        {
            WeAuctionMapController *auctMapVC = [[WeAuctionMapController alloc] init];
            [self pushWithController:auctMapVC];
        }
            break;
#pragma mark 跳转仿阿里云页面
        case 5:
        {
            WeHomePageController *homePageVC = [[WeHomePageController alloc] init];
            [self pushWithController:homePageVC];
        }
            break;
#pragma mark 跳转联系卖家
        case 6:
        {
            WeSellerMessageController *sMsgVC = [[WeSellerMessageController alloc] init
                                                 ];
            [self pushWithController:sMsgVC];
        }
        default:
            break;
    }
}

- (void)pushWithController:(UIViewController *)vc {
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}


@end
